#include "networkfailedresponse.h"

using namespace network;
FailedResponse::FailedResponse(const FailedResponse::DataError &error,
                        const QString &message,
                        QObject *parent):
    Response(parent),
    m_dataError(error),
    m_dataMessage(message),
    m_networkError(QNetworkReply::NoError),
    m_networkMessage("")
{

}

FailedResponse::FailedResponse(const QNetworkReply::NetworkError &error,
                        const QString &message,
                        QObject *parent):
    Response(parent),
    m_dataError(FailedResponse::NoError),
    m_dataMessage(""),
    m_networkError(error),
    m_networkMessage(message)

{
}

Response::Type FailedResponse::type() const
{
    return::Response::Failed;
}

QVariant FailedResponse::data() const
{
    QVariantMap map;
    map.insert("networkError", m_networkError);
    map.insert("networkMessage", m_networkMessage);
    map.insert("dataError", m_dataError);
    map.insert("dataMessage", m_dataMessage);
    return map;
}
